package org.example.prototypePattern;

/**
 * @BelongsProject: javaFoundation
 * @BelongsPackage: org.example.prototypePattern
 * @Author: dtq
 * @CreateTime: 2023-12-14  17:29
 * @Description: TODO
 * @Version: 1.0
 */
public class Client {
    public static void main(String[] args) {
        Teacher teacher = new Teacher();
        teacher.setName("okay");
        teacher.setIdNo("0001");

        Student student = new Student();
        student.setIdNo("stu_001");
        student.setName("onesun");
        student.setTeacher(teacher);

        System.out.println("---------------------------");
        System.out.println(student);
        System.out.println("idNo = " + student.getIdNo());
        System.out.println("name = " + student.getName());
        System.out.println("teacher = " + student.getTeacher());

        for (int i = 0; i < 10; i++) {
            System.out.println("---------------------------");
            Student cloneStudent = student.clone();
            System.out.println(cloneStudent);
            System.out.println("idNo = " + cloneStudent.getIdNo());
            System.out.println("name = " + cloneStudent.getName());
            System.out.println("teacher = " + cloneStudent.getTeacher());
        }
    }

}
